(function() {
    'use strict';

    angular
        .module('app')
        .controller('RegisterController', RegisterController);


    RegisterController.$inject = ['$scope','$translate', '$timeout'];

    function RegisterController ($scope,$translate, $timeout) {
    	$scope.user={name:'max',email:'qwewq@ss.com',password:'123456'}
    	$scope.agree=true;
        $scope.register= function register () {
//            if (vm.registerAccount.password !== vm.confirmPassword) {
//                vm.doNotMatch = 'ERROR';
//            } else {
//                vm.registerAccount.langKey = $translate.use();
//                vm.doNotMatch = null;
//                vm.error = null;
//                vm.errorUserExists = null;
//                vm.errorEmailExists = null;
//
//                Auth.createAccount(vm.registerAccount).then(function () {
//                    vm.success = 'OK';
//                }).catch(function (response) {
//                    vm.success = null;
//                    if (response.status === 400 && response.data === 'login already in use') {
//                        vm.errorUserExists = 'ERROR';
//                    } else if (response.status === 400 && response.data === 'e-mail address already in use') {
//                        vm.errorEmailExists = 'ERROR';
//                    } else {
//                        vm.error = 'ERROR';
//                    }
//                });
//            }
        }
    }
})();
